{@
	$sclms = array();

	$ds_readed = $ci['readed_count']->display == 'Y';
	$ds_voted = $ci['voted_count']->display == 'Y';

	$ci['last_update']->display = 'N';
	$ci['last_updater']->display = 'N';

	$ci['content']->display = 'N';
	$ci['tag']->display = 'N';

	$mi->star_style!='N' ? $ci['blamed_count']->display = 'N' : 0;
	$mi->star_style!='N' && $ds_voted ? $ci['readed_count']->display = 'N' : 0;

	$lang->short_readed_count ? $ci['readed_count']->name = $lang->short_readed_count : 0;
	$lang->short_blamed_count ? $ci['blamed_count']->name = $lang->short_blamed_count : 0;
	$lang->short_voted_count ? $ci['voted_count']->name = $lang->short_voted_count : 0;
	$mi->star_style!='N' ? $ci['voted_count']->name = $lang->star_column : 0; 0;

	$colcnt = $sotcnt = 0;
	$is_notice_widget = !$is_doc && $mi->use_notice_widget=='widget';
}
<!--@if($is_notice_widget)-->
	{@
		$a_lsttp2 = array(''=>&$document_list);
		$a_lsttp = array('notice'=>&$notice_list,'best'=>&$best_list);
	}
<!--@else-->
	{@ $a_lsttp2 = array('notice'=>&$notice_list,'best'=>&$best_list,''=>&$document_list)}
<!--@endif-->

<block loop="$ci => $key,$val" cond="$val->display=='Y'">
	{@
		$colcnt ++;
		$sotcnt += $val->sort=='Y'?1:0;
		$sclms[$key] = $val;
	}
</block>

{@ $sotcnt = $mi->display_document_count=='N'?1:$sotcnt}

<include cond="$is_notice_widget && (count($notice_list) || count($best_list))" target="_etc.noticewidget.html" />

<div cond="!$is_qalst || $grant->write_document" id="siHrm" class="memo clearBar noheader">
	<ul class="scFrm">
		<li>
			<form ruleset="insertDocument" action="./" method="post">
				<input type="hidden" name="module_srl" value="{$mi->module_srl}" />
				<input type="hidden" name="act" value="procBoardInsertDocument" />
				<input type="hidden" name="allow_comment" value="Y" />
				<input type="hidden" name="content" value="1" />
				<input type="hidden" name="success_return_url" value="{$oEntry->getUrl('act','','is_modal','','document_srl','','comment_srl','','document_no','','scroll_target','','cpage','','page','')}" />
				<block cond="!$is_logged">
					<label cond="$mi->use_input_guest_info != 'N'" class="scLaEt">
						<span>Name</span>
						<input type="text" name="nick_name" maxlength="80" disabled="disabled"|cond="!$grant->write_document" />
					</label>
					<block cond="$mi->use_input_guest_info == 'N'">
						<input type="hidden" name="nick_name" value="{$oThis->getIpaddress(1)}" />
					</block>
					<label class="scLaEt">
						<span>Pass</span>
						<input type="password" name="password" disabled="disabled"|cond="!$grant->write_document" />
					</label>
				</block>
				<block cond="$is_logged">
					<input type="hidden" name="nick_name" value="1" />
					<input type="hidden" name="password" value="1" />
				</block>
				<block cond="!$category_srl&&$is_cts" loop="$cts => $val" cond="$val->category_srl">
					{@ $category_srl = $val->category_srl}
					<?php break; ?>
				</block>
				<input cond="$category_srl" type="hidden" name="category_srl" value="{$category_srl}" />
				<input type="text" name="title" maxlength="255" <!--@if(!$grant->write_document)-->class="scScontent scGotoLoginPage" readonly="readonly" placeholder="{$lang->msg_write_not_permitted}"<!--@else-->class="scScontent"<!--@endif--> />
				<span class="scBtn black small"><button type="submit" accesskey="w" disabled="disabled"|cond="!$grant->write_document">{$lang->cmd_submit}</button></span>
			</form>
		</li>
	</ul>
</div>

<!-- LIST -->
<table id="siLst" class="list memo{$mi->display_list_header=='N'?' noheader':''}" width="100%" border="0" cellspacing="0" summary="List of document">
<thead cond="$mi->display_list_header != 'N'" class="scOneCol"|cond="!$sotcnt">
	<tr>
		<!--@if($sotcnt)-->
		<th loop="$sclms => $key,$val" scope="row" class="{$key}{($val->sort == 'Y')?' sort':''}">
			<div><span><!--@if($val->sort == 'Y')--><a href="{$oEntry->getUrl('sort_index',$key,'order_type',($order_type!='asc'?'asc':'desc'))}">{$val->name}<em class="asc"|cond="$sort_index==$key&&$order_type=='asc'">&nbsp;</em></a><!--@else-->{$val->name}<!--@endif--></span></div>
		</th>
		<th scope="row"><div><span>+</span></div></th>
		<!--@else-->
		<th scope="row" colspan="{$colcnt+1}">
		<div>&nbsp;
			<span class="scHaDCnts">
				<em>Today</em> <strong>{$oThis->getDocumentCountByDate(date("Ymd"))}</strong>,
				<em>Yesterday</em> <strong>{$oThis->getDocumentCountByDate(date("Ymd",strtotime("-1 day", time())))}</strong>,
				<em>Total</em> <strong>{$total_count}</strong>
			</span>
		</div>
		</th>
		<!--@endif-->
		<td cond="$grant->manager" class="scCheck sort"><div><input type="checkbox" onclick="XE.checkboxToggleAll({ doClick:true }); return false;" /></div></td>
	</tr>
</thead>
{@
	$ds_nick = $sclms['nick_name'];
	$ds_user = $sclms['user_name'];
}
<tbody loop="$a_lsttp2 => $tlk,$p_list" cond="count($p_list)" class="{$tlk}">
	<block loop="$p_list => $no,$document">
	{@
		$doc_srl = $document->document_srl;
		$is_grant = $grant->view && (!$document->isSecret() || $document->isGranted());
		$is_locked = $is_cklok?$oThis->isLocked($oDocument->document_srl):0;
		$is_blind = ($tlk!='notice'&&$mi->use_blind=='Y')?$oThis->isBlind($doc_srl):0;
		$purl = $oEntry->getUrl('','mid',$mid,'document_srl',$doc_srl,'sort_index',$sort_index,'order_type',$order_type,'search_target',$search_target,'search_keyword',$search_keyword,'page',$spage);

		$un_extra = ($is_rtrpt||$ao_ppang||$ds_mtlng)?$document->get('extra_vars'):null;
		$un_extra = is_string($un_extra)?unserialize($un_extra):$un_extra;

		$is_wcmt = $grant->write_comment && $document->isEnableComment() && $document->allowComment();
		$is_cmt = $document->getCommentcount();
	}
	<tr>
		<td loop="$sclms => $key,$val" cond="$key" scope="col" class="{$key}" style="color:{$val->color}"|cond="$val->color">
			<!--@switch($key)-->
				<!--@case('no')-->
					{@ $no = $tlk?'<img src="img/common/label_'.$tlk.'.gif" alt="'.$tlk.'" />':$no}
					{($tlk&&$doc_srl==$document_srl)?'<strong class="sCkChr">&radic;</strong>':($is_qalst?'<strong class="q">Q</strong>':$no)}
				<!--@break-->
				<!--@case('category_srl')-->
					{@ $cate = $is_cts?$cts[$document->get('category_srl')]:0 }
					<a cond="$cate" href="{$oEntry->getUrl('','mid',$mid,'category_srl',$cate->category_srl)}" title="{htmlspecialchars($cate->description)}" style="color:{$cate->color}"|cond="$cate->color">{$cate->title}</a>
					<span cond="!$cate">{$lang->none_category}</span>
				<!--@break-->
				<!--@case('title')-->
					<div class="scElps" data-active="true"|cond="$is_elips">
						<a cond="$is_cmt" href="#open" class="scToggle fl"  data-target="#siMemoSrl-{$doc_srl},#siMemoSrl-{$doc_srl} .scFrm">{$is_blind?$lang->msg_is_blind:$document->getTitle($mi->title_length)}</a>
						<span cond="!$is_cmt" class="fl">{$is_blind?$lang->msg_is_blind:$document->getTitle($mi->title_length)}</span>
						<span cond="!$is_qalst" class="fr">
							{@
								$t_cmtn = $document->getCommentCount();
								$t_tbkn = $document->getTrackbackCount();
							}
							<em cond="$t_cmtn" class="reply" title="Replies">+{$t_cmtn}</em><em cond="$t_tbkn" class="trackback" title="Trackbacks">.{$t_tbkn}</em>
							<em cond="!$t_cmtn&&!$t_tbkn">&nbsp;</em>
							{$document->printExtraImages(60*60*$mi->duration_new)}<img class="scIcoSet world" src="img/common/blank.gif" alt="multilingual" title="multilingual" cond="$ds_mtlng&&count($un_extra->beluxe->langs)" />
							<block cond="$ao_ppang&&$un_extra->ppang&&$un_extra->ppang->d->p>0">
								{@$ao_pppt = sprintf($lang->bonus_pang_pang, $un_extra->ppang->d->p)}
								<img class="scIcoSet coin" src="img/common/blank.gif" title="{$ao_pppt}" alt="{$ao_pppt}" />
							</block>
						</span>
					</div>
				<!--@break-->
				<!--@case('nick_name')-->
				<!--@case('user_name')-->
					{@
						$mbsl = $document->get('member_srl');
						$home = $document->get('homepage');
						$nick = cut_str((!$mbsl||$key=='nick_name')?$document->getNickName():$document->getUserName(), $mi->nickname_length);
					}
					<i cond="!$mbsl && !$home">{$nick}</i>
					<span cond="$mbsl" class="scHLink member_{$mbsl}">{$nick}</span>
					<i cond="!$mbsl && $home" class="scHLink" data-href="{$home}">{$nick}</i>
				<!--@break-->
				<!--@case('custom_status')-->
					<span class="custom_status_{(int)$document->get('is_notice')}"|cond="$tlk!='notice'">{$tlk&&$tlk=='notice'?$lang->notice:$cstus[(int)$document->get('is_notice')]}</span>
				<!--@break-->
				<!--@case('voted_count')-->
				<!--@case('blamed_count')-->
					<!--@if($mi->star_style!='N')-->
						{@
							$votedp = (int)$document->get('voted_count');
							$blamedp = (int)$document->get('blamed_count');
							$totalp = $votedp?(($votedp / ($votedp + abs($blamedp)) * 100) * 0.5):0;
						}
						<span cond="$ds_readed" class="scRdStar color{$mi->star_style}" title="{$lang->readed_count}">{$document->get('readed_count')}</span>
						<span class="scVtStar color{$mi->star_style}" title="{$lang->voted_count}: {$votedp.'/'.$blamedp}"><em style="width:{$totalp}px"></em></span>
					<!--@else-->
						{$document->get($key)}
					<!--@endif-->
				<!--@break-->
				<!--@case('regdate')-->
					{$document->getRegdate()}
				<!--@break-->
				<!--@default-->
					{($ci[$key]->idx > 0)?$document->getExtraValueHTML($ci[$key]->idx):$document->get($key)}
			<!--@endswitch-->
		</td>
		<td scope="col" class="scItem scMemoCtr"><a name="document_{$doc_srl}"></a>
			<a cond="(!$is_qalst && ($is_wcmt || $is_cmt)) || ($is_qalst && !$is_wcmt)" href="#reply" class="scToggle" data-target="#siMemoSrl-{$doc_srl},#siMemoSrl-{$doc_srl} .scFrm" title="{($is_qalst && !$is_wcmt) ? $lang->cmd_open : $lang->cmd_reply}">&crarr;</a>
			<a cond="$is_qalst && $is_wcmt" href="{$us_modal?'#siModalWin':$oEntry->getUrl('act','dispBoardWriteComment','comment_srl','','document_srl',$doc_srl)}" class="modalAnchor"|cond="$us_modal" data-mode="insert" data-type="comment" title="{$lang->cmd_reply}">&crarr;</a>
			<block cond="!$is_qalst || $grant->write_document">
				<a cond="$is_locked || !$document->isEditable()" href="#delete" title="{$lang->cmd_delete}" onclick="return alert('{htmlspecialchars($lang->msg_not_permitted)}') || false;">X</a>
				<a cond="!$is_locked && $document->isEditable()" href="{$us_modal?'#siModalWin':$oEntry->getUrl('act','dispBoardDelete','document_srl',$doc_srl,'document_no','')}" class="{$us_modal?'modalAnchor ':''}" data-mode="delete" title="{$lang->cmd_delete}">X</a>
			</block>
		</td>
		<td cond="$grant->manager" class="scCheck"><input type="checkbox" name="cart" value="{$doc_srl}" onclick="doAddDocumentCart(this)" checked="checked"|cond="$document->isCarted()" /></td>
	</tr>
	<tr id="siMemoSrl-{$doc_srl}" class="scMRp" style="display:none">
		<td colspan="{$colcnt+2}"><a cond="$document_no&&($document_no==$doc_srl)" name="comment"></a>
			<!--@if(!$document_srl)-->{@ Context::set('cpage', '')}<!--@endif-->
			{@ $cmts = $is_cmt ? $oThis->getCommentList($doc_srl, $cpage, $cmt_lstcnt) : 0 }
			<ul id="siFbk" class="scFrm" style="display:none">
				<li cond="!$is_qalst && $is_wcmt" class="scMRpWrt">
					<block cond="!$is_logged">
						<label cond="$mi->use_input_guest_info != 'N'" class="scLaEt">
							<span>Name</span>
							<input type="text" data-name="nick_name" maxlength="80" />
						</label>
						<block cond="$mi->use_input_guest_info == 'N'">
							<input type="hidden" data-name="nick_name" value="{$oThis->getIpaddress(1)}" />
						</block>
						<label class="scLaEt">
							<span>Pass</span>
							<input type="password" data-name="password" />
						</label>
					</block>
					<block cond="$is_logged">
						<input type="hidden" data-name="nick_name" value="1" />
						<input type="hidden" data-name="password" value="1" />
					</block>
					<input type="text" data-name="content" maxlength="255" />
					<span class="scBtn black small"><button data-srl="{$doc_srl}">{$lang->cmd_submit}</button></span>
				</li>
				<block cond="$is_cmt && count($cmts->data)">
				<li loop="$cmts->data=>$comment" class="scLi">
					<div class="scCmtCon clearBar">
						<div class="fl">
							{$is_qalst?$comment->getContent(false):$comment->getSummary(255)}
						</div>
						<span class="author fr">
							<block cond="$ds_nick || $ds_user">
							{@
								$mbsl = $document->get('member_srl');
								$home = $document->get('homepage');
								$nick = cut_str((!$mbsl||$ds_nick)?$comment->getNickName():$comment->getUserName(), $mi->nickname_length);
							}
							<!--@if(!$mbsl)--><i>{$nick}</i><!--@else--><strong>{$nick}</strong><!--@endif-->
							&nbsp;
							</block>
							<block cond="$is_qalst && $grant->write_comment">
								<a cond="$comment->isEditable()" href="{$us_modal?'#siModalWin':$oEntry->getUrl('act','dispBoardWriteComment','comment_srl',$comment->comment_srl,'document_srl',$doc_srl)}" class="{$us_modal?'modalAnchor ':''}modify" data-mode="update" data-type="comment" data-srl="{$doc_srl},{$comment->comment_srl}" title="{$lang->cmd_modify}">M</a>
							</block>
							<block cond="!$is_qalst || $grant->write_comment">
								<a cond="!$comment->isEditable()" href="#delete" title="{$lang->cmd_delete}" onclick="return alert('{htmlspecialchars($lang->msg_not_permitted)}') || false;">X</a>
								<a cond="$comment->isEditable()" href="{$us_modal?'#siModalWin':$oEntry->getUrl('act','dispBoardDeleteComment','comment_srl',$comment->comment_srl,'document_srl',$doc_srl)}" class="{$us_modal?'modalAnchor ':''}delete" data-mode="delete" data-type="comment" data-srl="{$doc_srl},{$comment->comment_srl}" title="{$lang->cmd_delete}">X</a>
							</block>
							<strong cond="$is_qalst && !$grant->write_comment"  class="a">A</strong>
						</span>
					</div>
				</li>
				<li cond="$cmts->total_page > 1" class="scPageArea">
					<span class="scPage">
						<a href="{$oEntry->getUrl('comment_srl','','cpage','1','document_no',$doc_srl)}#comment" class="direction prev"><span></span><span></span> {$lang->first_page}</a>
						<block loop="$page_no=$cmts->page_navigation->getNextPage()">
							<strong cond="$cpage==$page_no">{$page_no}</strong>
							<a cond="$cpage!=$page_no" href="{$oEntry->getUrl('comment_srl','','cpage',$page_no,'document_no',$doc_srl)}#comment">{$page_no}</a>
						</block>
						<a href="{$oEntry->getUrl('comment_srl','','cpage',$cmts->page_navigation->last_page,'document_no',$doc_srl)}#comment" class="direction next">{$lang->last_page} <span></span><span></span></a>
					</span>
				</li>
				</block>
			</ul>
		</td>
	</tr>
	</block>
</tbody>
<tbody cond="!count($document_list)"><tr><td colspan="{count($sclms)+2}">{$lang->no_documents}</td></tr></tbody>
</table>

<form ruleset="insertComment" action="./" method="post" id="siMemoRpFrm">
	<input type="hidden" name="module_srl" value="{$mi->module_srl}" />
	<input type="hidden" name="act" value="procBoardInsertComment" />
	<input type="hidden" name="success_return_url" value="{$oEntry->getUrl('act','','is_modal','','document_srl','','comment_srl','','document_no','','parent_srl','','cpage','','scroll_target','comment')}" />
	<input type="hidden" name="text_editor" value="Y" />
	<input cond="$is_qalst" type="hidden" name="use_html" value="Y" />
	<input type="hidden" name="nick_name" value="" />
	<input type="hidden" name="password" value="" />
	<input type="hidden" name="content" value="" />
	<input type="hidden" name="document_srl" value="" />
</form>
<!-- /LIST -->

<script type="text/javascript">
//<![CDATA[
<!--@if($document_no)-->
	jQuery(function($){
		$('tr[id=siMemoSrl-{$document_no}]').prev().scrollIntoView();
		$('#siMemoSrl-{$document_no},#siMemoSrl-{$document_no} .scFrm').slideToggle();
	});
<!--@endif-->
//]]>
</script>